#!/usr/bin/env php
<?php
namespace app\debug;

# 脚本初始化
defined('LOG_FILE') or define('LOG_FILE', __DIR__.'/log/log.log');
ini_set('memory_limit', '1024M');
ini_set('error_log', LOG_FILE);
date_default_timezone_set('PRC');
set_time_limit(0);

require('vendor/autoload.php');
require('vendor/yiisoft/yii2/Yii.php');

use Yii;
use yii\base\BaseObject;

class MyObject extends BaseObject
{

    /**
     * 描述
     * @var type
     */
    public $attr1;
    /**
     * Getter for $attr1;
     * @return
     */
    public function getAttr1()
    {
        return $this->attr1;
    }

    /**
     * Setter for $attr1
     * @param type 设置 $attr1 的值
     * @return self
     */
    public function setAttr1($attr1)
    {
        $this->attr1 = $attr1;
        echo $attr1, PHP_EOL;
        return $this;
    }
}

// $baseObj = Yii::createObject(['class'=>'app\debug\MyObject','attr1'=>'bbb']);

print_r(implode(PHP_EOL, get_class_methods('yii\base\BaseObject')));
// $baseObj = new MyObject(['attr1'=>'ccc']);

exit;
